<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/5/20 0020
 * Time: 上午 11:13
 */
namespace app\index\controller;
use app\index\controller\Base;
class BaseUser extends Base{

    function __construct(){
        parent::__construct();
        $header=request()->header();
        if($header['auth']==false){
            $this->apiJosn([],201,'auth没有,用户没有登陆');
        }else{
            //var_dump($header['auth']);
            $arr=$this->get_info_by_token($header['auth']);
            //var_dump($arr);
            if($arr!=false){
                //var_dump($arr);
                $this->user_id=$arr['user_id'];

            }
        }
    }

    function get_user_id(){
        return $this->user_id;
    }


}